{block name="main"}
			<!-- page -->
                <form class="v-filter-container">
                    <div class="filter-fields-wrap">
                        <div class="filter-item clearfix">
                            <div class="filter-item__field">
                                <div class="v__control-group">
                                    <label class="v__control-label">店主</label>
                                    <div class="v__controls">
                                        <input type="text" id="search_text" class="v__control_input" placeholder="用户名/昵称" autocomplete="off">
                                    </div>
                                </div>

                                <div class="v__control-group">
                                    <label class="v__control-label">手机号</label>
                                    <div class="v__controls">
                                        <input type="text" id="iphone" class="v__control_input" autocomplete="off">
                                    </div>
                                </div>

                                <div class="v__control-group">
                                    <label class="v__control-label">店主等级</label>
                                    <div class="v__controls">
                                        <select class="v__control_input" id="level" >
                                            <option value="">请选择等级</option>
                                            {foreach name="Shopkeeper_level" item="value"}
                                            <option value="{$value.id}">{$value.level_name}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="filter-item clearfix">
                            <div class="filter-item__field">
                                <div class="v__control-group">
                                    <label class="v__control-label"></label>
                                    <div class="v__controls">
                                        <a class="btn btn-primary search"><i class="icon icon-search"></i> 搜索</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>

			<div class="screen-title">
				<span class="text">信息列表</span>
			</div>
			<table class="table v-table table-auto-center">
				<thead>
				<tr>
					<th>店主</th>
					<th>会员信息</th>
					<th>手机</th>
					<th>店主等级</th>
					<th class="col-md-2 pr-14 operationLeft">操作</th>
				</tr>
				</thead>
				<tbody id="list">

				</tbody>
			</table>
			<input type="hidden" id="page_index" value="">
			<nav aria-label="Page navigation" class="clearfix">
				<ul id="page" class="pagination pull-right"></ul>
			</nav>
			<!-- page end -->
{/block}
{block name="script"}
<script>
    require(['util'],function(util){
        var status = 5;
        util.initPage(getList);
        function getList(page_index){
            $("#page_index").val(page_index);
            var level = $("#level").val();
            var search_text = $("#search_text").val();
            var iphone = $("#iphone").val();
            $.ajax({
                type : "post",
                url : '{$shopkeeperListUrl}',
                async : true,
                data : {
                    "page_index" : page_index, "search_text" : search_text, "level_id" : level, "isshopkeeper" : status,"iphone":iphone
                },
                success : function(data) {
                    var html = '';
                    if (data["data"].length>0) {
                        for (var i = 0; i < data["data"].length; i++) {
                            html += '<tr>';
                            if(data["data"][i]["user_headimg"]){
                                html +='<td><img src="'+__IMG(data["data"][i]["user_headimg"])+'" width="30" height="30"></td>';
                            }else{
                                html +='<td><img src="/public/static/images/headimg.png" width="30" height="30"></td>';
                            }
                            html += '<td>' + data['data'][i]["member_name"] + '</span></td>';
							html += '<td>' + data['data'][i]["mobile"] + '</span></td>';
							html += '<td><span class="block">' + data['data'][i]["level_name"] + '</span>';
							html += '<td class="fs-0 operationLeft"><a class="btn-operation" href="'+__URL('ADDONS_MAINshopkeeperInfo&Shopkeeper_id='+ data['data'][i]['uid']) +'">详情</a>';
							html += '<a class="btn-operation del" href="javascript:;" data-id="' + data['data'][i]['uid'] +'">移除</a>';
							html += '</td>';
                            html += '</tr>';
                        }
                    } else {
                        html += '<tr><td class="h-200" colspan="5">暂无符合条件的数据记录</td></tr>';
                    }
                    $('#page').paginator('option', {
                        totalCounts: data['total_count']  // 动态修改总数
                    });
                    $("#list").html(html);
                }
            });
        }
        $('.search').on('click',function(){
            util.initPage(getList(1));
        });
        $('body').on('click','.del',function(){
            var uid = $(this).data('id');
            util.alert('是否移除该店主？',function(){
                $.ajax({
                    type : "post",
                    url : "{$delShopkeeperUrl}",
                    data:{'uid':uid},
                    async : true,
                    success : function(data) {
                        if(data["code"] > 0 ){
                            util.message(data["message"], 'success', getList($("#page_index").val()));
                        }else{
                            util.message(data["message"], 'danger');
                        }
                    }
                });
            })
        })
    })
</script>
{/block}